import 'package:FiduMart/generated/json/base/json_field.dart';
import 'package:FiduMart/generated/json/icon_entity.g.dart';
import 'dart:convert';
export 'package:FiduMart/generated/json/icon_entity.g.dart';

@JsonSerializable()
class IconEntity {
	int? id;
	String? picture;
	String? address;
	int? type;
	@JSONField(name: "icon_nameZh")
	String? iconNamezh;
	@JSONField(name: "icon_nameEn")
	String? iconNameen;
	@JSONField(name: "icon_nameTha")
	String? iconNametha;
	@JSONField(name: "jiao_nameZh")
	String? jiaoNamezh;
	@JSONField(name: "jiao_nameEn")
	String? jiaoNameen;
	@JSONField(name: "jiao_nameTha")
	String? jiaoNametha;
	@JSONField(name: "AR_name")
	String? arName;
	int? titledisplay;

	IconEntity();

	factory IconEntity.fromJson(Map<String, dynamic> json) => $IconEntityFromJson(json);

	Map<String, dynamic> toJson() => $IconEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}

	String getIconName(String language){
		if(language == "zh"){
			return iconNamezh??"";
		}else if(language == "en"){
			return iconNameen??"";
		}else{
			return iconNametha??"";
		}
	}

	String getJiaoName(String language){
		if(language == "zh"){
			return jiaoNamezh??"";
		}else if(language == "en"){
			return jiaoNameen??"";
		}else{
			return jiaoNametha??"";
		}
	}

}